<!--
 * @Author: GL
 * @Date: 2022-09-21 22:30:33
 * @LastEditors: GL
 * @LastEditTime: 2023-04-03 23:32:40
 * @Description: 主页
-->
<template>
  <div class="common-layout">
    <el-container class="top">
      <el-header>
        <head-bar></head-bar>
      </el-header>
      <el-container class="main">
        <el-aside>
          <aside-bar></aside-bar>
        </el-aside>
        <el-main>
          <router-view></router-view>
        </el-main>
      </el-container>
    </el-container>
  </div>
</template>

<script>
import headBar from "../components/head.vue";
import asideBar from "../components/aside.vue";
export default {
  data() {
    return {}
  },
  created() {
    const key = sessionStorage.getItem('token')
    if (!key) {
      this.$router.push('/login')
    }
  },
  components:{
    headBar,
    asideBar
  }
}
</script>

<style lang="scss" scoped>
.common-layout{
  height: 100vh;
  overflow: hidden;
  .top{
    .el-header{
      
      padding: 0;
    }
    .main{
      margin-top: 4px;
      // overflow-y: scroll;
      height: 90vh;
  }
  }
}
</style>